package api

import (
	"easyShop/services"
	"github.com/gin-gonic/gin"
)

type CategoryController struct{}

func (p CategoryController) GetRecommend(c *gin.Context) {
	categoryRecommend, err := services.GetRecommend()
	if err != nil {
		c.JSON(200, gin.H{
			"code":    500,
			"message": err.Error(),
			"data":    []string{},
		})
		return
	}

	c.JSON(200, gin.H{
		"code":    200,
		"message": "success",
		"data":    categoryRecommend,
	})
}
